package com.wisely.highlight_spring4.ch2.prepost;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName PrePostConfig
 * @Package com.wisely.highlight_spring.ch2.prepost
 * @Description TODO
 * @Author zjb
 * @Date 2018/7/20 10:55
 * @Version 1.0
 **/
@Configuration
@ComponentScan("com.wisely.highlight_spring.ch2.prepost")
public class PrePostConfig {
    //initMethod 和 destroyMethod指定BeanWayService类的init和destroy方法在构造之后、Bean销毁之前执行
    @Bean(initMethod = "init",destroyMethod = "destroy")
    BeanWayService beanWayService(){
        return new BeanWayService();
    }
    @Bean
    JSR250WayService jsr250WayService(){
        return new JSR250WayService();
    }
}
